package com.pac.weixin.dao.impl;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.pac.weixin.bean.WxChatAutoBean;
import com.pac.weixin.dao.WxChatAutoDao;

/**
 * <一句话功能简述> <功能详细描述>
 * 
 * @author lujun.chen
 * @version [版本号, 2015年3月11日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Repository(value = "wxChatAutoDao")
public class WxChatAutoDaoImpl implements WxChatAutoDao {

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public String addWxChatAuto(WxChatAutoBean wxChatAutoBean) {
		sqlSessionTemplate.insert("addWxChatAuto", wxChatAutoBean);
		return wxChatAutoBean.getId();
	}

	@Override
	public boolean updateWxChatAuto(WxChatAutoBean wxChatAutoBean) {
		int n = sqlSessionTemplate.update("updateWxChatAuto", wxChatAutoBean);
		return n > 0;
	}

	@Override
	public boolean delWxChatAuto(WxChatAutoBean wxChatAutoBean) {
		int n = sqlSessionTemplate.delete("delWxChatAuto", wxChatAutoBean);
		return n > 0;
	}

	@Override
	public List<WxChatAutoBean> queryWxChatAuto(WxChatAutoBean wxChatAutoBean) {

		return sqlSessionTemplate.selectList("queryWxChatAuto", wxChatAutoBean);
	}

}
